﻿namespace LizardChess
open System
open System.Linq

module Piece =
    let create(name,squareord,pciswhite,lastmoveturnno,noofmoves,hasbeenpromoted,id)=
        {
            Name = name;
            SquareOrd = squareord;
            pcIsWhite = pciswhite;
            LastMoveTurnNo = lastmoveturnno;
            NoOfMoves = noofmoves;
            HasBeenPromoted = hasbeenpromoted;
            ID = id;
         }
    let blank = create(enmName.Null,-1,false,-1,-1,false,enmID.Null)
    let abbrev(pn) =
        match pn with
            |enmName.Pawn -> "P"
            |enmName.Bishop -> "B"
            |enmName.Knight -> "N"
            |enmName.Rook -> "R"
            |enmName.King -> "K"
            |enmName.Queen -> "Q"
            |_ -> ""

